package framework.core.popup
{
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.geom.Point;


public class PopUpManager
{
	private static var proxy:IPopUpProxy;
	private static var container:DisplayObjectContainer;
	
	public static function initialize():void
	{
		container = Game.instance.popUpLayer;
		proxy = new DefaultPopUpProxy();
		
		proxy.initialize(container);
	}
	
	public static function show(displayObj:DisplayObject, centre:Boolean = true, position:Point = null, lock:Boolean = false, ...args):void
	{
		proxy.show.apply(proxy, [ displayObj, centre, position, lock ].concat(args));
	}
	
	public static function close(displayObj:DisplayObject):void
	{
		proxy.close.apply(proxy, [ displayObj ]);
	}
}
}